package com.jb.platform.admin.mapper;

import com.jb.platform.admin.entity.UserEntity;
import com.jb.platform.core.mybatis.BaseMapperX;
import com.jb.platform.core.mybatis.query.LambdaQueryWrapperX;
import com.jb.platform.core.pojo.page.PageParam;
import com.jb.platform.core.pojo.page.PageResult;
import org.apache.ibatis.annotations.Mapper;


@Mapper
public interface UserMapper extends BaseMapperX<UserEntity> {


    default PageResult<UserEntity> selectPage(PageParam reqVO, String name) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserEntity>()
                .likeIfPresent(UserEntity::getUsername,name)
                .orderByDesc(UserEntity::getId));
    }
}
